package cn.edu.cqut.test8;

import cn.edu.cqut.test0409.Birthday;
import cn.edu.cqut.test1.Person;

public class TestClone {
	public static void main(String[] args) throws Exception {
		Person per = new Person("张三",20);
		per.bir = new Birthday();
		per.bir.year = 2010;
		Person per1 = (Person)per.clone();
		per1.bir.year = 2011;
		System.out.println(per.toString());//2010
		System.out.println(per1.toString());//2011
//		System.out.println(per==per1);//false
//		System.out.println(per.equals(per1));//true
	}
}
